package routers

import (
	"resource_web/ginx/api"
	"resource_web/ginx/middleware"

	"github.com/gin-gonic/gin"
)

func NewRouter() *gin.Engine {
	router := gin.Default()

	v1 := router.Group("api")
	{
		//v1.POST("register", api.UserRegister)
		v1.POST("login", api.UserLogin)
		//v1.GET("GetSocket", api.GetSocketData)
		auth := v1.Group("/") //需要登陆保护
		auth.Use(middleware.JWT())
		{
			OrderManagerApi(auth)
		}
	}
	return router
}
